// $Id$
using System;
using System.Data;
using System.Data.Common;
using Salamanca.DataAccess;
using Salamanca.DataAccess.Collections;

namespace Northwind.DomainModel.Data
{

    /// <summary />
    public static partial class Mappers
    {

        /// <summary />
        public static DataMapperCollection CreateDataMapperCollection(DbConnection connection, ICacheManager cacheManager)
        {
            DataMapperCollection ret=new DataMapperCollection();
            ret.Add(typeof(Category), new CategoryMapper(connection, cacheManager ?? Category.IdentityMap.CacheManager));
            ret.Add(typeof(Customer), new CustomerMapper(connection, cacheManager ?? Customer.IdentityMap.CacheManager));
            ret.Add(typeof(Employee), new EmployeeMapper(connection, cacheManager ?? Employee.IdentityMap.CacheManager));
            ret.Add(typeof(Order), new OrderMapper(connection, cacheManager ?? Order.IdentityMap.CacheManager));
            ret.Add(typeof(Product), new ProductMapper(connection, cacheManager ?? Product.IdentityMap.CacheManager));
            ret.Add(typeof(Shipper), new ShipperMapper(connection, cacheManager ?? Shipper.IdentityMap.CacheManager));
            ret.Add(typeof(Supplier), new SupplierMapper(connection, cacheManager ?? Supplier.IdentityMap.CacheManager));
            ret.Add(typeof(OrderDetails), new OrderDetailsMapper(connection, cacheManager ?? OrderDetails.IdentityMap.CacheManager));

            return ret;
        }
    }

}
